package com.chenpp.redis.lru;

/**
 * @Description
 * @Author chenpp
 * @Date 2019/10/21 19:49
 */
public class Test {
    public static void main(String[] args) {
        LRUCache<String,String> cache = new LRUCache<String, String>(5);
        cache.put("a","111");
        cache.put("b","2121");
        cache.put("c","3231");
        cache.put("d","2122");
        cache.put("e","2131");
        System.out.println(cache.get("3"));//e d c b a
        System.out.println(cache.get("a"));// a e d c b
        cache.put("f","13123");// f a e d c
        System.out.println(cache.get("b"));
        System.out.println(cache.get("a"));// a f e d c
        cache.put("g","g");// g a f e d
        cache.put("c","31");// c g a f e
        System.out.println(cache.get("d"));
        System.out.println(cache.get("c"));
    }
}
